#include "pcf8575ts_conf.h"
#include "i2c.h"

void pcf8575ts_i2c_init(void)
{
    PY_I2C1_Init();
}
void pcf8575ts_i2c_master_receive(uint8_t* data, uint16_t len)
{
    HAL_I2C_Master_Receive(&hi2c1, PCF8575TS_I2C_ADDRESS, data, len, HAL_MAX_DELAY);
}

void pcf8575ts_i2c_master_transmit(uint8_t* data, uint16_t len)
{
    HAL_I2C_Master_Transmit(&hi2c1, PCF8575TS_I2C_ADDRESS, data, len, HAL_MAX_DELAY);
}

bool pcf8575ts_i2c_is_ready(void)
{
    return HAL_I2C_IsDeviceReady(&hi2c1, PCF8575TS_I2C_ADDRESS, 3, 100);
}
